//
//  TaobaoViewController.m
//  AntsExpress
//
//  Created by slccper on 16/1/12.
//  Copyright © 2016年 slccper. All rights reserved.
//

#import "TaobaoViewController.h"
#import "clsOtherFun.h"
@interface TaobaoViewController ()
@property (weak, nonatomic) IBOutlet UILabel *no;
@property (weak, nonatomic) IBOutlet UILabel *name;
@property (weak, nonatomic) IBOutlet UITextView *Mark;
@property (weak, nonatomic) IBOutlet UITextField *Adress;
@property (weak, nonatomic) IBOutlet UITextField *sjame;
@property (weak, nonatomic) IBOutlet UILabel *Address;
@end

@implementation TaobaoViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    if ([[clsOtherFun getMemberId] integerValue]>0) {
        self.no.text = [NSString stringWithFormat:@"會員編號：%ld",[[clsOtherFun getMemberId] integerValue]+600000];
        NSString *addressStr = [self.dic objectForKey:@"Adress"];
        NSRange range = [addressStr rangeOfString:@"街道"];
        NSString *insert = [NSString stringWithFormat:@"（%ld）",[[clsOtherFun getMemberId] integerValue]+600000];
        if (range.length == 0){
            range = NSMakeRange(addressStr.length, 0);
            insert = [NSString stringWithFormat:@"轉%ld",[[clsOtherFun getMemberId] integerValue]+600000];
        }
        NSMutableString *mutableStr = [[NSMutableString alloc]initWithString:addressStr];
        [mutableStr insertString:insert atIndex:range.location+range.length];
        [self.Adress setText:mutableStr];
        [self.sjame setText:[NSString stringWithFormat:@"%@+%ld",[clsOtherFun getMemberName],[[clsOtherFun getMemberId] integerValue]+600000]];
    }else{
        self.no.text = [NSString stringWithFormat:@"會員編號："];
        [self.Adress setText:[NSString stringWithFormat:@"請先登錄！"]];
    }
    if (![[clsOtherFun getName] isEqualToString:@""]) {
        self.name.text = [NSString stringWithFormat:@"收件人：%@",[clsOtherFun getName]];
    }else{
        self.name.text = [NSString stringWithFormat:@"收件人："];
    }
    self.Mark.text = [self.dic objectForKey:@"Mark"];
//    [self.Address setText:[self.dic objectForKey:@"Adress"]];
    self.title=@"淘寶收貨地址";
    
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
